1 Import data
We are going to import three datasets that comes from the Enviro-Net open-data platform. This data sets are:
- carbon_tower_streams: Data from the Carbon Tower that it’s from the streams sensor station
- carbon_tower_eddy: Data from the Carbon Tower that it’s from the Eddy Co. sensor station
- principe_tower_eddy: Data from the Principe Tower that it’s from the Eddy Co. sensor station
carbon_tower_streams <- read_csv("data/COSTARICA-SantaRosaNationalPark,Guanacaste_CarbonTower(New)_Streams_Streams(12345)_20181228_20190128.csv") %>%
clean_names()
carbon_tower_eddy <- read_csv("data/COSTARICA-SantaRosaNationalPark,Guanacaste_CarbonTower(New)_EddyCo._CampbellCR3000(1)_20130607_20190512.csv") %>%
clean_names()
principe_tower_eddy <- read_csv("data/COSTARICA-SantaRosaNationalPark,Guanacaste_PrincipeTower(New)_EddyCo._CampbellCR3000(2)_20151213_20190622.csv") %>%
clean_names()1.1 Notes on datasets
- All datapoints are on 30 min intervals
2 carbon_tower_streams EDA
In order to understand the structure of the data set please check the DICTIONARY file
Note Even if you select a date range from 2013 to present in the enviro-net portal, there are just two months available to retrieve.
2.1 Evapotranspiration EDA from streams
First we check the months and years available in the data set:
carbon_tower_streams %>%
mutate(date = as_date(date_time)) %>%
group_by(year(date), month(date)) %>%
tally() %>%
ungroup() %>%
rename("Year" = `year(date)`,
"Month" = `month(date)`,
"Total observations" = "n") %>%
gt() %>%
tab_header(
title = md("**Total observations per date**"),
subtitle = ("For the carbon tower data streams")
) | Total observations per date | ||
|---|---|---|
| For the carbon tower data streams | ||
| Year | Month | Total observations |
| 2018 | 12 | 192 |
| 2019 | 1 | 1308 |
The date range we have available is 2018-12-28 00:00:19, 2019-01-28 05:30:19,
that’s just one month.
# Evapotranspiration
carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(x = date_time, y = evapotranspiration)) +
geom_point() +
# Si tenemos datetime, cambiamos el scale_x
scale_x_datetime(date_labels = "%d-%b-%Y", date_breaks = "1 day") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 90)) +
labs(title = "Evapotranspiration from the Carbon tower in Santa Rosa",
subtitle = "Data from the streams sensor station that includes the
evapotranspiration calculation",
x = "Date", y = "Evapotranspiration kg m-2 s-1")# day <- interval(hms("06:00:00"), hms("17:30:00"))
# carbon_tower_streams %>%
# mutate(day = ifelse(hms(date_time) > hms("06:00:00") &
# hms(date_time) > hms("17:00:00"),
# "dia", "noche")) %>%
# select(date_time, day) %>% View()carbon_tower_streams %>%
separate(col = date_time, into = c("date", "time"), sep = " ") %>%
mutate(time = hms(time),
day = ifelse(hms(time) > hms("05:20:00") &
hms(time) < hms("17:20:00"),
"day", "nigth")) %>%
replace_na(list(day = "nigth")) %>%
ggplot(aes(x = date, y = evapotranspiration, colour = day)) +
geom_jitter(alpha = 0.5, size = 2) +
theme_light(base_size = 12) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
scale_y_continuous(breaks = seq(-0.2, 0.2, by = 0.02)) +
labs(title = "Evapotranspiration carbon tower Santa Rosa",
subtitle = "Day defined as the interval of date time from 05:20:00 to 17:20:00",
x = "Date",
y = "Evapotranspiration kg m-2 s-1",
fill = "Day period")There are some values with high latent_heat_flux and thus high evapotranspiration values in the night. Is this normal or is due to an error?
I defined day as those observations between the date_time > 05:20:00 and
date_time 17:20:00 in order to check this values
# Check nigth values with evapotranspiration close to day values
## above 0.04 we can try to explore those values in the nigth category
carbon_tower_streams %>%
separate(col = date_time, into = c("date", "time"), sep = " ") %>%
mutate(time = hms(time),
day = ifelse(hms(time) > hms("05:20:00") &
hms(time) < hms("17:20:00"),
"day", "nigth")) %>%
# This replace is due to the 00:00 time format
replace_na(list(day = "nigth")) %>%
filter(evapotranspiration > 0.04) %>%
DT::datatable(
rownames = FALSE,
extensions = 'Buttons',
selection = list(mode = 'single', target = 'row'),
options = list(
lengthMenu = list(c(20, 50, 100, -1), c('20', '50', '100', 'All')),
dom = 'Bflp',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print'),
scrollX = T)) # Revisión de datos de evapotranspiracion y latent heat
check <- carbon_tower_streams %>%
separate(col = date_time, into = c("date", "time"), sep = " ") %>%
mutate(time = hms(time),
day = ifelse(hms(time) > hms("05:20:00") &
hms(time) < hms("17:20:00"),
"day", "nigth")) %>%
replace_na(list(day = "nigth")) %>%
mutate(eva_plus = ifelse(evapotranspiration > 0.04, "high", "low"))
# ¿Qué características tienen los puntos de noche con eva > 0.04?
check %>%
select(time, day, evapotranspiration, latent_heat_flux) %>%
filter(evapotranspiration > 0.04, day == "nigth") %>%
arrange(desc(evapotranspiration)) %>%
head(15) %>%
gt() %>%
tab_header(
title = "High evapotranspiration values during nigth",
subtitle = "For the carbon tower data streams"
)| High evapotranspiration values during nigth | |||
|---|---|---|---|
| For the carbon tower data streams | |||
| time | day | evapotranspiration | latent_heat_flux |
| 18H 0M 19S | nigth | 0.09996834 | 99.96835 |
| 22H 0M 19S | nigth | 0.08141080 | 81.41080 |
| 19S | nigth | 0.07540219 | 75.40219 |
| 21H 0M 19S | nigth | 0.07431184 | 74.31184 |
| 1H 0M 19S | nigth | 0.06476972 | 64.76971 |
| 18H 30M 19S | nigth | 0.06440952 | 64.40952 |
| 3H 0M 19S | nigth | 0.06401478 | 64.01479 |
| 21H 30M 19S | nigth | 0.05914803 | 59.14803 |
| 3H 0M 19S | nigth | 0.05582307 | 55.82307 |
| 1H 30M 19S | nigth | 0.05388340 | 53.88340 |
| 18H 0M 19S | nigth | 0.05166006 | 51.66006 |
| 19S | nigth | 0.05098506 | 50.98506 |
| 3H 30M 19S | nigth | 0.04974208 | 49.74208 |
| 23H 30M 19S | nigth | 0.04831424 | 48.31424 |
| 4H 0M 19S | nigth | 0.04739451 | 47.39450 |
# Notar que el latent heat flux es la multiplicacion de
# evapotranspiracion * mil
# check %>%
# # filter(eva_plus == "high") %>%
# ggplot(aes(x = evapotranspiration, y = latent_heat_flux, colour = day)) +
# geom_jitter(alpha = 0.3, size = 2) +
# theme_light()2.2 Exploration of other variables behaviour trough dates availables
This are some plots to explore and understand the behaviour of other variables
in the dataset carbon_tower_streams trough time.
# Water vapor mass density carbon
carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(x = date_time, y = ambient_water_vapor_mass_density)) +
geom_line() +
# Si tenemos datetime, cambiamos el scale_x
scale_x_datetime(date_labels = "%d-%b-%Y", date_breaks = "1 day") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 90)) +
labs(title = "Water vapor mass density carbon tower Santa Rosa",
x = "Date", y = "Water vapor mass density kg m-3")# Latent heat flux
carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(x = date_time, y = latent_heat_flux)) +
geom_line() +
# Si tenemos datetime, cambiamos el scale_x
scale_x_datetime(date_labels = "%d-%b-%Y", date_breaks = "1 day") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 90)) +
labs(title = "Latent heat flux carbon tower Santa Rosa",
x = "Date", y = "Latent heat flux W m-2")# Net ecosystem exchange
carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(x = date_time, y = net_ecosystem_exchange_mmol_m_2_s_1 )) +
geom_line() +
# Si tenemos datetime, cambiamos el scale_x
scale_x_datetime(date_labels = "%d-%b-%Y", date_breaks = "1 day") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 90)) +
labs(title = "Net ecosystem exchange carbon tower Santa Rosa",
x = "Date", y = "Net ecosystem exchange mmol m2 s1")2.3 Relations between variables
Just to understand evapotranspiration behaviour against other variables
carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(y = evapotranspiration,
x = net_ecosystem_exchange_mmol_m_2_s_1 )) +
geom_point() +
geom_smooth(method = "lm") +
theme_light(base_size = 16)carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(y = evapotranspiration,
x = latent_heat_flux)) +
geom_point() +
geom_smooth(method = "lm") +
theme_light(base_size = 16)carbon_tower_streams %>%
mutate(date = ymd_hms(date_time)) %>%
ggplot(aes(y = evapotranspiration,
x = ambient_water_vapor_mass_density)) +
geom_point() +
geom_smooth(method = "lm") +
theme_light(base_size = 16)3 carbon_tower_eddy EDA
In order to understand the structure of the data set please check the DICTIONARY file
Note
# Select variables to play with
eddy <- carbon_tower_eddy %>%
select(date_time, sensible_heat_flux, co2_flux, latent_heat_flux,
mean_co2_concentration, mean_h2o_vapour_concentration,
mean_moist_air_density, mean_thermocouple_temp)
# Check available dates in the data set
eddy %>%
group_by(year(date_time), month(date_time,
label = TRUE,
locale = Sys.getlocale("LC_CTYPE"))) %>%
tally() %>%
rename(
Year = `year(date_time)`,
Month = `month(date_time, label = TRUE, locale = Sys.getlocale("LC_CTYPE"))`,
Observations = "n"
) %>%
gt() %>%
tab_header(
title = md("**Total of observations per year and month**"),
subtitle = ("For the carbon tower eddy data")
) %>%
fmt_number(columns = vars(Observations),
decimals = 0,
use_seps = TRUE) %>%
data_color(
columns = vars(Month),
colors = scales::col_factor("Spectral", domain = NULL)
)| Total of observations per year and month | |
|---|---|
| For the carbon tower eddy data | |
| Month | Observations |
| 2013 | |
| Jun | 1,125 |
| Jul | 1,130 |
| Aug | 1,459 |
| Sep | 1,441 |
| Oct | 1,301 |
| Nov | 1,444 |
| Dec | 1,492 |
| 2014 | |
| Jan | 1,034 |
| Feb | 1,079 |
| Mar | 333 |
| Apr | 900 |
| May | 1,163 |
| Jun | 1,443 |
| Jul | 1,492 |
| Aug | 1,492 |
| Sep | 1,443 |
| Oct | 1,491 |
| Nov | 1,443 |
| Dec | 594 |
| 2015 | |
| Jan | 1,323 |
| Feb | 1,124 |
| Mar | 884 |
| Apr | 1,444 |
| May | 1,428 |
| Jun | 1,439 |
| Jul | 1,491 |
| Aug | 1,369 |
| Sep | 1,443 |
| Oct | 1,493 |
| Nov | 1,443 |
| Dec | 1,381 |
| 2016 | |
| Jan | 1,491 |
| Feb | 515 |
| Mar | 1,492 |
| Apr | 1,444 |
| May | 807 |
| Jun | 274 |
| Jul | 1,491 |
| Aug | 1,491 |
| Sep | 1,443 |
| Oct | 444 |
| Nov | 1,444 |
| Dec | 1,492 |
| 2017 | |
| Jan | 1,492 |
| Feb | 1,344 |
| Mar | 1,491 |
| Apr | 1,444 |
| May | 852 |
| Jun | 155 |
| Jul | 1,197 |
| Sep | 1,673 |
| Oct | 3,212 |
| Nov | 933 |
| 2019 | |
| Mar | 403 |
| Apr | 2,085 |
| May | 1,092 |
# Por mes agregado por año
eddy %>%
group_by(year(date_time), month(date_time)) %>%
tally() %>%
ggplot(aes(x = as.factor(`month(date_time)`),
y = n,
fill = as.factor(`year(date_time)`))) +
geom_bar(stat = "identity") +
scale_fill_viridis_d() +
labs(x = "Month", y = "Total observations", fill = "Year") +
theme_light(base_size = 16)# Separados por mes y por año
eddy %>%
group_by(zoo::as.yearmon(date_time)) %>%
tally() %>%
rename("date" = `zoo::as.yearmon(date_time)`, "total" = "n") %>%
ggplot(aes(x = as.factor(date),
y = total,
fill = as.factor(year(date)))) +
geom_bar(stat = "identity") +
scale_fill_viridis_d() +
labs(x = "Month", y = "Total observations", fill = "Year") +
theme_light(base_size = 21) +
theme(axis.text.x = element_text(angle = 70, h = 1))3.1 Evapotranspiracion calculation with bigleafR
We can obtain evapotranspiration with the bigleafR function, in which we
can use Latent Heat Flux (W m-2) with Air Temperature (C) to obtain
evapotranspiracion (kg m-2 s-1)
evapotranspiration <- eddy %>%
mutate(evapotranspiration_kg = LE.to.ET(latent_heat_flux,
mean_thermocouple_temp)) %>%
# Transform units
mutate(evapotranspiration_mol = kg.to.mol((evapotranspiration_kg) * 1000))With the dataset carbon_tomer_streams we saw that there is a strong
correlation between latent_heat_flux and evapotranspiration and it’s
basically latent_heat_flux * 1000. I want to check if this is the same
with the results obtained using the bigleafR package:
evapotranspiration %>%
select(latent_heat_flux, evapotranspiration_kg) %>%
head(20) %>%
gt() %>%
tab_header(
title = md("**Comparison of Latent Heat Flux with Evapotranspiration**"),
subtitle = "For the Carbon Tower eddy data"
) %>%
tab_footnote(
footnote = "Shows only the first 20 observations",
locations = cells_column_labels(
columns = vars(latent_heat_flux, evapotranspiration_kg)
)
)| Comparison of Latent Heat Flux with Evapotranspiration | |
|---|---|
| For the Carbon Tower eddy data | |
| latent_heat_flux1 | evapotranspiration_kg1 |
| 193.494202 | 0.00007960714624 |
| 230.060394 | 0.00009469096193 |
| 108.607399 | 0.00004469616681 |
| 34.383789 | 0.00001411770145 |
| 16.015671 | 0.00000657103328 |
| 21.067499 | 0.00000863878593 |
| 4.983779 | 0.00000204267645 |
| 1.355310 | 0.00000055534245 |
| -1.621751 | -0.00000066433338 |
| 2.481831 | 0.00000101648878 |
| 1.199968 | 0.00000049142718 |
| -3.899054 | -0.00000159664364 |
| 2.369925 | 0.00000097043228 |
| 2.766600 | 0.00000113293310 |
| -10.047530 | -0.00000411504511 |
| 6.833600 | 0.00000279878946 |
| -25.120621 | -0.00001029220326 |
| 0.162703 | 0.00000006666249 |
| 46.217941 | 0.00001892208373 |
| -71.067757 | -0.00002909555699 |
|
1
Shows only the first 20 observations
|
|
3.2 Exploratory visualizations from eddy
- Plot with all the evapotranspiration data points from 2013 to 2019
- There is no data for 2018 and only 3 months for 2019
evapotranspiration %>%
mutate(date = ymd_hms(date_time)) %>%
# filter values above 0.05
filter(evapotranspiration_mol < 1000 & evapotranspiration_mol > -500) %>%
# filter(year(date_time) == 2013) %>%
ggplot(aes(x = date_time, y = evapotranspiration_mol)) +
geom_point(alpha = 0.5) +
scale_x_datetime(date_labels = "%b", breaks = "months") +
theme_light(base_size = 21) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
labs(title = "Evapotranspiration carbon tower Santa Rosa",
subtitle = "Al the datapoints available",
x = "Date", y = "Evapotranspiration mmol m-2 s-1")plot_evapotranspiration <- function(data, year) {
data %>%
mutate(date = ymd_hms(date_time),
year = year(date_time)) %>%
# filter values above 0.05
# filter(evapotranspiration < 0.02 & evapotranspiration > -0.02) %>%
filter(year == !!year) %>%
ggplot(aes(x = date_time, y = evapotranspiration_mol)) +
geom_point(alpha = 0.5) +
# geom_line() +
scale_x_datetime(date_labels = "%b", breaks = "months") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
labs(title = "Evapotranspiration carbon tower Santa Rosa",
subtitle = paste("With all the datapoints available for", year),
x = "Date", y = "Evapotranspiration mmol m-2 s-1")
}
## Get years
years <- evapotranspiration %>%
transmute(year = year(date_time)) %>%
distinct() %>%
pull()
# Map to get all plots
map(.x = years, .f = function(plots) {
evapotranspiration %>%
plot_evapotranspiration(year = plots)
})## [[1]]
##
## [[2]]
##
## [[3]]
##
## [[4]]
##
## [[5]]
##
## [[6]]
4 principe_tower_eddy EDA
In order to understand the structure of the data set please check the DICTIONARY file
Note The data available in enviro-net from this tower does not contains
stream data. But it does have the variable air_temperature
# Select variables to play with
eddy <- principe_tower_eddy %>%
select(date_time, sensible_heat_flux, co2_flux, latent_heat_flux,
mean_co2_concentration, mean_h2o_vapour_concentration,
mean_moist_air_density, mean_thermocouple_temp,
air_temperature, humidity, saturation_vapour_pressure_k_pa)
# Check available dates in the data set
eddy %>%
group_by(year(date_time), month(date_time,
label = TRUE,
locale = Sys.getlocale("LC_CTYPE"))) %>%
tally() %>%
rename(
Year = `year(date_time)`,
Month = `month(date_time, label = TRUE, locale = Sys.getlocale("LC_CTYPE"))`,
Observations = "n"
) %>%
gt() %>%
tab_header(
title = md("**Total of observations per year and month**"),
subtitle = ("For the Principe tower eddy data")
) %>%
fmt_number(columns = vars(Observations),
decimals = 0,
use_seps = TRUE) %>%
data_color(
columns = vars(Month),
colors = scales::col_factor("Spectral", domain = NULL)
)| Total of observations per year and month | |
|---|---|
| For the Principe tower eddy data | |
| Month | Observations |
| 2015 | |
| Dec | 904 |
| 2016 | |
| Jan | 448 |
| 2017 | |
| Jul | 697 |
| Aug | 1,506 |
| Sep | 1,617 |
| Oct | 1,562 |
| 2018 | |
| Jan | 1,169 |
| Feb | 1,803 |
| Mar | 885 |
| May | 678 |
| Jul | 677 |
| Aug | 855 |
| Oct | 517 |
| Nov | 835 |
| 2019 | |
| Jan | 360 |
| Feb | 1,204 |
| Mar | 1,494 |
| Apr | 1,450 |
| May | 829 |
| Jun | 1,029 |
# Por mes agregado por año
eddy %>%
group_by(year(date_time), month(date_time)) %>%
tally() %>%
ggplot(aes(x = as.factor(`month(date_time)`),
y = n,
fill = as.factor(`year(date_time)`))) +
geom_bar(stat = "identity") +
scale_fill_viridis_d() +
labs(x = "Month",
y = "Total observations",
fill = "Year") +
theme_light(base_size = 12)# Separados por mes y por año
eddy %>%
group_by(zoo::as.yearmon(date_time)) %>%
tally() %>%
rename("date" = `zoo::as.yearmon(date_time)`, "total" = "n") %>%
ggplot(aes(x = as.factor(date),
y = total,
fill = as.factor(year(date)))) +
geom_bar(stat = "identity") +
scale_fill_viridis_d() +
theme_light(base_size = 21) +
labs(x = "Date", y = "Total observations", fill = "Year") +
theme(axis.text.x = element_text(angle = 70, h = 1))4.1 Evapotranspiracion calculation with bigleafR
evapotranspiration <- eddy %>%
mutate(evapotranspiration_kg = LE.to.ET(latent_heat_flux,
air_temperature)) %>%
# Transform units
mutate(evapotranspiration_mol = kg.to.mol((evapotranspiration_kg) * 1000))evapotranspiration %>%
select(latent_heat_flux, evapotranspiration_kg) %>%
head(20) %>%
gt() %>%
tab_header(
title = md("**Comparison of Latent Heat Flux with Evapotranspiration**"),
subtitle = "For the Principe tower eddy data"
) %>%
tab_footnote(
footnote = "Shows only the first 20 observations",
locations = cells_column_labels(
columns = vars(latent_heat_flux, evapotranspiration_kg)
)
)| Comparison of Latent Heat Flux with Evapotranspiration | |
|---|---|
| For the Principe tower eddy data | |
| latent_heat_flux1 | evapotranspiration_kg1 |
| 27.75327 | 0.000011361045 |
| 20.51730 | 0.000008398204 |
| 25.59195 | 0.000010475229 |
| 65.54984 | 0.000026847631 |
| 75.03687 | 0.000030745849 |
| 91.85464 | 0.000037640203 |
| 100.04420 | 0.000041005988 |
| 121.25880 | 0.000049701252 |
| 142.39890 | 0.000058389518 |
| 134.72060 | 0.000055268658 |
| 160.06419 | 0.000065684064 |
| 164.36459 | 0.000067486372 |
| 169.28529 | 0.000069531753 |
| 189.70660 | 0.000077929680 |
| 133.58501 | 0.000054883470 |
| 260.44470 | 0.000107044942 |
| 190.61430 | 0.000078374277 |
| 235.16400 | 0.000096675505 |
| 147.53140 | 0.000060628577 |
| 175.46950 | 0.000072108200 |
|
1
Shows only the first 20 observations
|
|
4.2 Exploratory visualizations from eddy
- Plot with al the data points of evapotranspiration from 2013 to 2019
- There is no data for 2018 and only 3 months for 2019
evapotranspiration %>%
mutate(date = ymd_hms(date_time)) %>%
# filter values above 0.05
# filter(evapotranspiration < 0.02 & evapotranspiration > -0.02) %>%
# filter(year(date_time) == 2013) %>%
ggplot(aes(x = date_time, y = evapotranspiration_mol)) +
geom_point(alpha = 0.5) +
scale_x_datetime(date_labels = "%b", breaks = "months") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
labs(title = "Evapotranspiration Principe tower Santa Rosa",
subtitle = "Al the datapoints available",
x = "Date", y = "Evapotranspiration mmol m-2 s-1")plot_evapotranspiration <- function(data, year) {
data %>%
mutate(date = ymd_hms(date_time),
year = year(date_time)) %>%
# filter values above 0.05
# filter(evapotranspiration < 0.02 & evapotranspiration > -0.02) %>%
filter(year == !!year) %>%
ggplot(aes(x = date_time, y = evapotranspiration_mol)) +
geom_point(alpha = 0.5) +
# geom_line() +
scale_x_datetime(date_labels = "%b", breaks = "months") +
theme_light(base_size = 16) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
labs(title = "Evapotranspiration Principe tower Santa Rosa",
subtitle = paste("With all the datapoints available for", year),
x = "Date", y = "Evapotranspiration kg m-2 s-1")
}
## Get years
years <- evapotranspiration %>%
transmute(year = year(date_time)) %>%
distinct() %>%
pull()
# Map to get all plots
map(.x = years, .f = function(plots) {
evapotranspiration %>%
plot_evapotranspiration(year = plots)
})## [[1]]
##
## [[2]]
##
## [[3]]
##
## [[4]]
##
## [[5]]
5 Evapotranpiration
5.1 Notes on calculating real evapotranspiration
- It looks that the function
LE.to.ETfrom thebigleafR package calculates potential evapotranspiration rather than real evapotranspiration. My guess is because we only need Latent Heat Flux and Air Temperature to calculate this, but the problem is that at least in Santa Rosa we have a dry season were there is almost no rain, and if there is no water, there is not going to be evaporation and transpiration. - From the
REddyProcpackage, it says that the function from thebigleafto calculate evapotranspiration, needs to be converted to mmol/m2/s because it’s on Kg/m2/s units. This can be done by the following:
LE <- seq(300, 500, by = 50)
Tair <- 25
ETkg <- LE.to.ET(LE, Tair)
(ETmmol <- kg.to.mol(ETkg) * 1000)evapotranspiration <- eddy %>%
mutate(evapotranspiration_kg = LE.to.ET(latent_heat_flux,
air_temperature)) %>%
# Transform units
mutate(evapotranspiration_mol = kg.to.mol((evapotranspiration_kg) * 1000))evapotranspiration %>%
mutate(date = ymd_hms(date_time)) %>%
# filter values above 0.05
# filter(evapotranspiration < 0.02 & evapotranspiration > -0.02) %>%
# filter(year(date_time) == 2013) %>%
ggplot(aes(x = date_time, y = evapotranspiration_mol)) +
geom_point(alpha = 0.5) +
scale_x_datetime(date_labels = "%b", breaks = "months") +
theme_light(base_size = 21) +
theme(axis.text.x = element_text(angle = 75, h = 1)) +
labs(title = "Evapotranspiration Principe tower Santa Rosa",
subtitle = "Al the datapoints available",
x = "Date", y = "Evapotranspiration mmol m-2 s-1")6 Session info
For this analysis, the setup used was:
sessionInfo()## R version 4.0.4 (2021-02-15)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.5 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=es_CR.UTF-8 LC_COLLATE=en_US.UTF-8
## [5] LC_MONETARY=es_CR.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=es_CR.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=es_CR.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] rmdformats_1.0.1 purrr_0.3.4 tidyr_1.1.3 gt_0.2.2
## [5] lubridate_1.7.10 bigleaf_0.7.1 visdat_0.5.3 janitor_2.1.0
## [9] readr_1.4.0 ggplot2_3.3.3 dplyr_1.0.5
##
## loaded via a namespace (and not attached):
## [1] zoo_1.8-9 tidyselect_1.1.0 xfun_0.22 bslib_0.2.4
## [5] lattice_0.20-41 splines_4.0.4 snakecase_0.11.0 colorspace_2.0-0
## [9] vctrs_0.3.6 generics_0.1.0 viridisLite_0.3.0 htmltools_0.5.1.1
## [13] mgcv_1.8-33 yaml_2.2.1 utf8_1.2.1 rlang_0.4.10
## [17] jquerylib_0.1.3 pillar_1.5.1 glue_1.4.2 solartime_0.0.1
## [21] withr_2.4.1 DBI_1.1.1 RColorBrewer_1.1-2 lifecycle_1.0.0
## [25] robustbase_0.93-7 stringr_1.4.0 commonmark_1.7 munsell_0.5.0
## [29] gtable_0.3.0 evaluate_0.14 labeling_0.4.2 knitr_1.31
## [33] fansi_0.4.2 highr_0.8 DEoptimR_1.0-8 Rcpp_1.0.6
## [37] scales_1.1.1 backports_1.2.1 checkmate_2.0.0 debugme_1.1.0
## [41] jsonlite_1.7.2 farver_2.1.0 hms_1.0.0 digest_0.6.27
## [45] stringi_1.5.3 bookdown_0.21 grid_4.0.4 cli_2.3.1
## [49] tools_4.0.4 magrittr_2.0.1 sass_0.3.1 tibble_3.1.0
## [53] crayon_1.4.1 pkgconfig_2.0.3 Matrix_1.3-2 ellipsis_0.3.1
## [57] assertthat_0.2.1 rmarkdown_2.7 rstudioapi_0.13 R6_2.5.0
## [61] nlme_3.1-152 compiler_4.0.4